package tools.FutureMode;

/**
 * @author Kevin
 * @date 2020/4/14 21:01
 */
public class Client {
    public Data request(final String querySet) {
        final FutureData future = new FutureData();
        new Thread(){
            public void run() {
                //RealData构建很慢，所以在单独的线程中进行
                try {
                    RealData realData = new RealData(querySet);
                    future.setRealData(realData);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();
        return future;
    }
}
